﻿CREATE VIEW [acms].[TemplateHierarchy_View]
AS 
	SELECT a.Id,
		a.Sequence,
		b.Id as ParentId,
		b.Name as ParentName,
		c.Id as ChildId,
		c.Name as ChildName,
		a.ConcurencyId
	FROM [TemplateHierarchy] a
		inner join [Template_View] b on a.ParentId = b.Id
		inner join [Template_View] c on a.ChildId = c.Id
;